<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>

<f:subview id="createOrder">
<h:form id="createOrderForm">
<h:panelGrid columns="1" styleClass="standard">
  <h:outputText value="Billing Information" styleClass="subTitle"/>
  <h:panelGrid columns="3" columnClasses="highLight,,">
    <h:outputText value="First Name"/>
    <h:inputText value="#{orderBean.order.billToFirstName}" id="billToFirstName" size="30" required="true"/>
    <h:message styleClass="errorMessage" for="billToFirstName"/>
    <h:outputText value="Last Name"/>
    <h:inputText value="#{orderBean.order.billToLastName}" id="billToLastName" size="30" required="true"/>
    <h:message styleClass="errorMessage" for="billToLastName"/>
    <h:outputText value="Street Address"/>
    <h:inputText value="#{orderBean.order.billAddress1}" id="billAddress1" size="55" required="true"/>
    <h:message styleClass="errorMessage" for="billAddress1"/>
    <h:outputText value=""/>
    <h:inputText value="#{orderBean.order.billAddress2}" id="billAddress2" size="55"/>
    <h:message styleClass="errorMessage" for="billAddress2"/>
    <h:outputText value="City"/>
    <h:inputText value="#{orderBean.order.billCity}" id="billCity" size="55" required="true"/>
    <h:message styleClass="errorMessage" for="billCity"/>
    <h:outputText value="State/Provice"/>
    <h:selectOneMenu value="#{orderBean.order.billState}" id="billState">
      <f:selectItem itemValue="CA" itemLabel="California"/>
      <f:selectItem itemValue="NY" itemLabel="New York"/>
      <f:selectItem itemValue="TX" itemLabel="Texas"/>
    </h:selectOneMenu>
    <h:message styleClass="errorMessage" for="billState"/>
    <h:outputText value="Postal Code"/>
    <h:inputText value="#{orderBean.order.billZip}" id="billZip" size="12" required="true"/>  
    <h:message styleClass="errorMessage" for="billZip"/>
    <h:outputText value="Country"/>
    <h:selectOneMenu value="#{orderBean.order.billCountry}" id="billCountry">
      <f:selectItem itemValue="USA" itemLabel="United States"/>
      <f:selectItem itemValue="Canada" itemLabel="Canada"/>
      <f:selectItem itemValue="Japan" itemLabel="Japan"/>
      <f:selectItem itemValue="China" itemLabel="China"/>
    </h:selectOneMenu>    
    <h:message styleClass="errorMessage" for="billCountry"/>
    <h:outputText value="Telephone Number"/>
    <h:inputText value="#{orderBean.order.billPhone}" id="billPhone" size="12"/>
    <h:message styleClass="errorMessage" for="billPhone"/>
    <h:outputText value="Email"/>
    <h:inputText value="#{orderBean.order.billEmail}" id="billEmail" size="30"/> 
    <h:message styleClass="errorMessage" for="billEmail"/>   
  </h:panelGrid>
  <h:outputText value="Shipping Information" styleClass="subTitle"/>
  <h:panelGrid columns="3" columnClasses="highLight,,">
      <h:outputText value="First Name"/>
    <h:inputText value="#{orderBean.order.shipToFirstName}" id="shipToFirstName" size="30" required="true"/>
    <h:message styleClass="errorMessage" for="shipToFirstName"/>
    <h:outputText value="Last Name"/>
    <h:inputText value="#{orderBean.order.shipToLastName}" id="shipToLastName" size="30" required="true"/>
    <h:message styleClass="errorMessage" for="shipToLastName"/>
    <h:outputText value="Street Address"/>
    <h:inputText value="#{orderBean.order.shipAddress1}" id="shipAddress1" size="55" required="true"/>
    <h:message styleClass="errorMessage" for="shipAddress1"/>
    <h:outputText value=" "/>
    <h:inputText value="#{orderBean.order.shipAddress2}" id="shipAddress2" size="55"/>
    <h:message styleClass="errorMessage" for="shipAddress2"/>
    <h:outputText value="City"/>
    <h:inputText value="#{orderBean.order.shipCity}" id="shipCity" size="55" required="true"/>
    <h:message styleClass="errorMessage" for="shipCity"/>
    <h:outputText value="State/Provice"/>
    <h:selectOneMenu value="#{orderBean.order.shipState}" id="shipState">
      <f:selectItem itemValue="CA" itemLabel="California"/>
      <f:selectItem itemValue="NY" itemLabel="New York"/>
      <f:selectItem itemValue="TX" itemLabel="Texas"/>
    </h:selectOneMenu>
    <h:message styleClass="errorMessage" for="shipState"/>
    <h:outputText value="Postal Code"/>
    <h:inputText value="#{orderBean.order.shipZip}" id="shipZip" size="12" required="true"/>  
    <h:message styleClass="errorMessage" for="shipZip"/>
    <h:outputText value="Country"/>
    <h:selectOneMenu value="#{orderBean.order.shipCountry}" id="shipCountry">
      <f:selectItem itemValue="USA" itemLabel="United States"/>
      <f:selectItem itemValue="Canada" itemLabel="Canada"/>
      <f:selectItem itemValue="Japan" itemLabel="Japan"/>
      <f:selectItem itemValue="China" itemLabel="China"/>
    </h:selectOneMenu>    
    <h:message styleClass="errorMessage" for="shipCountry"/>
    <h:outputText value="Telephone Number"/>
    <h:inputText value="#{orderBean.order.shipPhone}" id="shipPhone" size="12"/> 
    <h:message styleClass="errorMessage" for="shipPhone"/>
    <h:outputText value="Email"/>
    <h:inputText value="#{orderBean.order.shipEmail}" id="shipEmail" size="30"/> 
    <h:message styleClass="errorMessage" for="shipEmail"/>   
  </h:panelGrid>
  <h:messages globalOnly="true" styleClass="errorMessage"/> 
  <h:commandButton value="Submit" action="#{orderBean.createOrderAction}"/>
</h:panelGrid>
</h:form>
</f:subview>